# coding:utf-8
# author:frank
# date:2024/12/30
from math import pi

import pygame
pygame.init()
window = pygame.display.set_mode((400,600))
window.fill((255,255,255))
# 1.直线line(画布,颜色,起点,终点,线宽=1)
pygame.draw.line(window,"#ff0000",(10,20),(200,20),3)
# 2.折线lines(画布,颜色,是否闭合,[多个Point],线宽=1)
pygame.draw.lines(window,'#000000',True,[(0,50),(30,50),(100,100)])
# 3.圆形circle(画布,颜色,圆心坐标,半径,线宽=0)0表示实心圆
pygame.draw.circle(window,'blue',(200,500),50,2)
# 4.矩形rect(画布,颜色,(x,y,width,height),线宽=0,border_radius=最大是矩形宽或高的一半）0表示实心
pygame.draw.rect(window,'brown',(300,300,20,100),3,border_radius=10)
# 5.椭圆ellipse(画布,颜色,(x,y,width,height),线宽=0)0表示实心
pygame.draw.ellipse(window,'black',(300,300,20,100))
# 6.弧线arc(画布,颜色,(x,y,width,height),起始弧度,结束弧度,线宽=1) 弧度 = 角度 × (π ÷ 180)  π=180
pygame.draw.arc(window,'red',(300,300,20,100),0,pi)
# 刷新
pygame.display.flip()

while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            exit()